<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对比temolate与render的区别</title>
</head>
<body>
<div id="app">
    <com :level="num">{{content}}</com>
</div>
<script src="../vue.js"></script>
<script>
    var com = {
        props:{
            level:{
                type:Number,
            }
        },
        render:function (createElement,context) {
            return createElement('h'+this.level,this.$slots.default)
        }
    }
    new Vue({
        el:"#app",
        data(){
            return {
                num:4,
                content:'收到归属感'
            }
        },
        components:{
            com,
        }
    })
</script>
</body>
</html>